#ifndef BIO_PH_ENZYME_INCLUDED
#define BIO_PH_ENZYME_INCLUDED 1

#include "kernel/solution.hpp"
#include "yocto/intrusive-ptr.hpp"

#define BIO_PH_ENZYME_CALL(PFX) Real PFX addRate( Solution &dS, Real t, Real zeta_m,  const Solution &S_in, const Solution &S_out, const Cell &cell )
class Cell;
class Enzyme : public counted
{
public:
	virtual ~Enzyme() throw();
	
	const string        name;       //!< for database
	Real                V;          //!< Vmax
	Lua::Function<Real> efficiency; //!< scaling factor, time dependant
	
	const string &key() const throw();
	
	//! add the contribution to dS
	virtual BIO_PH_ENZYME_CALL() = 0;
	
protected:
	explicit Enzyme( lua_State *L, const string &id, const string &efficiency_name);
	
private:
	YOCTO_DISABLE_COPY_AND_ASSIGN(Enzyme);
};

typedef intrusive_ptr<string,Enzyme> EnzymePtr;
typedef set<string,EnzymePtr>        EnzymeDB;

#endif
